﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.IO;
using System.Collections.Generic;
using UnityEditor;
using UnityEditorInternal;
using System.Text.RegularExpressions;
using Newtonsoft.Json;

public class ImageFontTool
{
	static string imageFontDirName = "img_font";

//	[MenuItem("Custom/OldProject/ImageFont/CreateImageFontConfig")]
//	public static void CreateImageFontConfig()
//	{
//		string str = CommonUtil.fileToString(CreateSpriteSheet.bundleDir[0] + "/" + "raw_" + ResourcesEx.ImageFontConfigName + ".json");
//		SpriteSheetConfig config = JsonConvert.DeserializeObject<SpriteSheetConfig>(str);
//		MemoryStream stream = new MemoryStream();
//		BinaryWriter writer = new BinaryWriter(stream);
//		config.Write(writer);
//		File.WriteAllBytes(CreateSpriteSheet.bundleDir[0] + "/" + ResourcesEx.ImageFontConfigName + ".bytes", stream.ToArray());
//		AssetDatabase.Refresh();
//	}

//	[MenuItem("Custom/OldProject/ImageFont/test")]
//	public static void test()
//	{
//		Object testPrefab = AssetDatabase.LoadAssetAtPath(ResourcesEx.BundleResDir + "/RawUI/image_font/test_image_font.prefab", typeof(Object));
//		GameObject obj = testPrefab as GameObject;
//		Text text = obj.transform.GetChild(0).gameObject.GetComponent<Text>();
//		text.text = "\u00A9 \u00AE \u203C \u2049 \u2122 \u2139 \u2b07 \u26c5        \uf634";
//		EditorUtility.SetDirty(testPrefab);
//	}
	[MenuItem("Custom/ImageFont/CreateImageFont")]
	public static void CreateImageFont()
	{
		CreateImageFontSpriteSheet();
		SepareteImage();
		CreateImageFontSpriteSheetMaterial();
		CreateImageFont2();
		CreateEmojiConfig();
		DeleteSheetConfig();

        AssetDatabase.Refresh();
	}


	static void CreateFontSpriteSheet (string srcPath, string destPath, BuildTarget target)
	{
		SpriteSheetConfig config = EditorCommonTool.getImageFontConfig ();
		SpriteSheetConfig.Enumerator enumertaor = config.GetEnumerator ();
		while (enumertaor.MoveNext ())
		{
			string spName = enumertaor.Current.Key;
			string[] dirs = enumertaor.Current.Value.dirs;
			CreateSpriteSheet.createAllSpriteSheet6 (config, target, srcPath, destPath, spName, dirs);
		}
	}
	
	static void SepareteImage2(string resPath)
	{
		SpriteSheetConfig config = EditorCommonTool.getImageFontConfig ();
		SpriteSheetConfig.Enumerator enumertaor = config.GetEnumerator ();
		while (enumertaor.MoveNext ())
		{
			string spName = enumertaor.Current.Key;
			string outputPath = resPath + "/" + imageFontDirName + "/" + spName;
			string srcPath = outputPath + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ".png";
			MaterialTextureForETC1.SeperateRGBAandlphaChannel(srcPath, outputPath);

			string rgbTexPath = MaterialTextureForETC1.GetRGBTexPath (srcPath);
			CommonUtil.Move (rgbTexPath, srcPath);
		}

		AssetDatabase.Refresh();
	}

//	[MenuItem("Custom/OldProject/ImageFont/SepareteImage")]
	static void SepareteImage()
	{
        SepareteImage2(CreateSpriteSheet.bundleDir[0]);
//		SepareteImage2(CreateSpriteSheet.bundleDir[0] + "/" + Platform.android);
//		SepareteImage2(CreateSpriteSheet.bundleDir[0] + "/" + Platform.ios);
		AssetDatabase.Refresh();
	}

//	[MenuItem("Custom/OldProject/ImageFont/CreateImageFontSpriteSheet")]
	static void CreateImageFontSpriteSheet()
	{
		{
			string srcPath = "Assets/" + imageFontDirName;
			string destPath = CreateSpriteSheet.bundleDir[0] + "/" + imageFontDirName;
			CreateFontSpriteSheet (srcPath, destPath, EditorCommonTool.build_target_ios);
		}
//		{
//			string srcPath = "Assets/" + imageFontDirName;
//			string destPath = CreateSpriteSheet.bundleDir[0] + "/" + Platform.android + "/" + imageFontDirName;
//			CreateFontSpriteSheet (srcPath, destPath, BuildTarget.Android);
//		}
//		{
//			string srcPath = "Assets/" + imageFontDirName;
//			string destPath = CreateSpriteSheet.bundleDir[0] + "/" + Platform.ios + "/" + imageFontDirName;
//			CreateFontSpriteSheet (srcPath, destPath, EditorCommonTool.build_target_ios);
//		}

		AssetDatabase.Refresh();
	}

	static void NewMethod2 (string platform, string split)
	{
		string destPath = CreateSpriteSheet.bundleDir[0] + "/" + platform + split + imageFontDirName;
		SpriteSheetConfig config = EditorCommonTool.getImageFontConfig ();
		SpriteSheetConfig.Enumerator enumertaor = config.GetEnumerator ();
		while (enumertaor.MoveNext ())
		{
			string spName = enumertaor.Current.Key;
			string spriteSheetPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ".png";
			Texture2D tex = AssetDatabase.LoadAssetAtPath (spriteSheetPath, typeof(Texture2D)) as Texture2D;
			Shader shader = Shader.Find ("custom/" + platform + split + "imagefont");
			Material material = new Material (shader);
			material.mainTexture = tex;
			if(platform == Platform.android.ToString())
			{
				string alphaSpriteSheetPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ResourcesEx.SpriteSheetAlphaSuffix + ".png";
				Texture2D alphaTex = AssetDatabase.LoadAssetAtPath (alphaSpriteSheetPath, typeof(Texture2D)) as Texture2D;
				material.SetTexture("_MaskTex", alphaTex);
			}
			AssetDatabase.CreateAsset (material, destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ResourcesEx.spriteSheetUiMaterialSuffix + ".mat");
		}
	}

	static void NewMethod3 (string platform, string split)
	{
		string destPath = CreateSpriteSheet.bundleDir[0] + "/" + platform + split + imageFontDirName;
		SpriteSheetConfig config = EditorCommonTool.getImageFontConfig ();
		SpriteSheetConfig.Enumerator enumertaor = config.GetEnumerator ();
		while (enumertaor.MoveNext ())
		{
			string spName = enumertaor.Current.Key;
			string spriteSheetPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ".png";
			Texture2D tex = AssetDatabase.LoadAssetAtPath (spriteSheetPath, typeof(Texture2D)) as Texture2D;
			Shader shader = Shader.Find ("custom/splitalpha/imagefont");
			Material material = new Material (shader);
			material.mainTexture = tex;
			string alphaSpriteSheetPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ResourcesEx.SpriteSheetAlphaSuffix + ".png";
			Texture2D alphaTex = AssetDatabase.LoadAssetAtPath (alphaSpriteSheetPath, typeof(Texture2D)) as Texture2D;
			material.SetTexture("_MaskTex", alphaTex);
			AssetDatabase.CreateAsset (material, destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ResourcesEx.spriteSheetUiMaterialSuffix + ".mat");
		}
	}

	static void createEmojiMaterial (string platform, string split)
	{
		string destPath = CreateSpriteSheet.bundleDir[0] + "/" + platform + split + imageFontDirName;
		SpriteSheetConfig config = EditorCommonTool.getImageFontConfig ();
		SpriteSheetConfig.Enumerator enumertaor = config.GetEnumerator ();
		while (enumertaor.MoveNext ())
		{
			string spName = enumertaor.Current.Key;
			Shader shader = Shader.Find ("custom/splitalpha/ui");
			Material material = new Material (shader);
			string alphaSpriteSheetPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ResourcesEx.SpriteSheetAlphaSuffix + ".png";
			Texture2D alphaTex = AssetDatabase.LoadAssetAtPath (alphaSpriteSheetPath, typeof(Texture2D)) as Texture2D;
			material.SetTexture("_MaskTex", alphaTex);
			AssetDatabase.CreateAsset (material, destPath + "/emoji_mat" + ".mat");
		}
	}

//	[MenuItem("Custom/OldProject/ImageFont/CreateImageFontSpriteSheetMaterial")]
	static void CreateImageFontSpriteSheetMaterial()
	{
		NewMethod3 ("", "");
//		NewMethod3 (Platform.ios.ToString(), "/");
//		NewMethod3 (Platform.android.ToString(), "/");

//		createEmojiMaterial ("", "");
//		createEmojiMaterial (Platform.ios.ToString(), "/");
//		createEmojiMaterial (Platform.android.ToString(), "/");

		AssetDatabase.Refresh();
	}

	static void CreateImageFont3(string platform, string split)
	{
		string srcPath = "Assets/" + imageFontDirName;
		string destPath = CreateSpriteSheet.bundleDir[0] + "/" + platform + split + imageFontDirName;
		SpriteSheetConfig config = EditorCommonTool.getImageFontConfig ();
		SpriteSheetConfig.Enumerator enumertaor = config.GetEnumerator ();
		while (enumertaor.MoveNext ())
		{
			string spName = enumertaor.Current.Key;
			string dataPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ".tpsheet";
			string spriteSheetPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ".png";
			Texture2D tex = AssetDatabase.LoadAssetAtPath (spriteSheetPath, typeof(Texture2D)) as Texture2D;
			string matPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ResourcesEx.spriteSheetUiMaterialSuffix + ".mat";
			Material mat = AssetDatabase.LoadAssetAtPath (matPath, typeof(Material)) as Material;
			string[] dirs = enumertaor.Current.Value.dirs;
            float fontSize = 0;
			for (int k = 0; k < dirs.Length; k++)
			{
				string dir = dirs [k];
				Dictionary<string, DataSheetInfo> sheetInfoMap = TexturePackerImporter.ParseDataFile (dataPath);
				DirectoryInfo dirInfo = new DirectoryInfo (srcPath + "/" + dir);
				FileInfo[] files = dirInfo.GetFiles ("*.png", SearchOption.TopDirectoryOnly);
				CharacterInfo[] charInfos = new CharacterInfo[files.Length];
				for (int j = 0; j < files.Length; j++) {
					FileInfo fileInfo = files [j];
					string filePath = fileInfo.FullName.Replace("\\", "/").Replace (EditorCommonTool.getProjectPath () + "/", "");
					Sprite sprite = AssetDatabase.LoadAssetAtPath (filePath, typeof(Sprite)) as Sprite;
					string fileName = Path.GetFileNameWithoutExtension (fileInfo.FullName);
					DataSheetInfo info = null;
					if(!sheetInfoMap.TryGetValue (dir + "-" + fileName, out info))
					{
						Debug.LogError("not found " + dir + "-" + fileName);

//                        string log = "";
//                        Dictionary<string, DataSheetInfo>.Enumerator e = sheetInfoMap.GetEnumerator();
//                        while (e.MoveNext())
//                        {
//                            if (e.Current.Key.Contains("vip"))
//                            {
//                                log += log + "\n" + e.Current.Key;
//                            }
//                        }
//
//                        Debug.LogError(log);
						return;
					}

					char index = fileName [0];
					if(fileName.Length == 4)
					{
						int temp = System.Convert.ToInt32(fileName, 16);
						index = (char)temp;
					}
					else if(fileName.Length > 1 && fileName[1] == '_')
					{
						if(fileName[0] == '_')
						{
							index = ' ';
						}
						else
						{
							index = (char)('A' - 'a' + index);
						}
					}

					CharacterInfo charInfo = new CharacterInfo ();
					charInfo.index = index;
					charInfo.width = sprite.rect.width;
					charInfo.flipped = false;
					{
						Rect r = new Rect ();
						r.x = info.rect.x / tex.width;
						r.y = info.rect.y / tex.height;
						r.width = info.rect.width / tex.width;
						r.height = info.rect.height / tex.height;
						charInfo.uv = r;
					}
					{
						Vector4 padding = MaterialTextureForETC1.getSpritePadding (info.pivot, info.rect, 1, sprite.rect);
						Rect r = new Rect ();
						r.x = padding [0];
						r.y = padding [3];
						r.width = info.rect.width;
						r.height = info.rect.height;
						r.y = -r.y;
						r.height = -r.height;
						charInfo.vert = r;

                        fontSize = info.rect.height + Mathf.Abs(padding[1]) + Mathf.Abs(padding[3]);
					}
					charInfos [j] = charInfo;
				}

				Font font = new Font ();
				font.material = mat;
				font.name = dir;
				font.characterInfo = charInfos;
				string fontPath = destPath + "/" + dir + ".fontsettings";
				AssetDatabase.CreateAsset (font, fontPath);
				string content = File.ReadAllText (fontPath);
                content = Regex.Replace (content, "(\\s+m_LineSpacing:\\s*)(.*)", "${1}" + fontSize);
                content = Regex.Replace (content, "(\\s+m_FontSize:\\s*)(.*)", "${1}" + fontSize);
				CommonUtil.stringToFile (fontPath, content);
				AssetDatabase.ImportAsset (fontPath);


			}
		}
	}

	static void DeleteSheetConfig()
	{
		DeleteSheetConfig2 ("", "");
//		DeleteSheetConfig2 (Platform.android.ToString(), "/");
//		DeleteSheetConfig2 (Platform.ios.ToString(), "/");
	}

	static void DeleteSheetConfig2(string platform, string split)
	{
		string destPath = CreateSpriteSheet.bundleDir[0] + "/" + platform + split + imageFontDirName;
		SpriteSheetConfig config = EditorCommonTool.getImageFontConfig ();
		SpriteSheetConfig.Enumerator enumertaor = config.GetEnumerator ();
		while (enumertaor.MoveNext ())
		{
			string spName = enumertaor.Current.Key;
			string dataPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ".tpsheet";
			CommonUtil.Delete(dataPath);
		}
	}

//	static void CreateEmojiConfig2(string platform, string split)
//	{
//		string srcPath = "Assets/" + imageFontDirName;
//		string destPath = CreateSpriteSheet.bundleDir[0] + "/" + platform + split + imageFontDirName;
//		SpriteSheetConfig config = EditorCommonTool.getImageFontConfig ();
//		SpriteSheetConfig.Enumerator enumertaor = config.GetEnumerator ();
//		while (enumertaor.MoveNext ())
//		{
//			string spName = enumertaor.Current.Key;
//			string dataPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ".tpsheet";
////			string spriteSheetPath = destPath + "/" + spName + "/" + spName + ResourcesEx.SpriteSheetTexSuffix + ".png";
////			Texture2D tex = AssetDatabase.LoadAssetAtPath (spriteSheetPath, typeof(Texture2D)) as Texture2D;
//			string[] dirs = enumertaor.Current.Value.dirs;
//			for (int k = 0; k < dirs.Length; k++)
//			{
//				string dir = dirs [k];
//				if(dir != "emoji")
//				{
//					continue;
//				}
//
//				Dictionary<string, DataSheetInfo> sheetInfoMap = TexturePackerImporter.ParseDataFile (dataPath);
//				DirectoryInfo dirInfo = new DirectoryInfo (srcPath + "/" + dir);
//				FileInfo[] files = dirInfo.GetFiles ("*.png", SearchOption.TopDirectoryOnly);
//
//				EmojiInfo emojiInfo = new EmojiInfo();
//				for (int j = 0; j < files.Length; j++)
//				{
//					FileInfo fileInfo = files [j];
//					string filePath = fileInfo.FullName.Replace (EditorCommonTool.getProjectPath () + "/", "");
//					Sprite oldSprite = AssetDatabase.LoadAssetAtPath (filePath, typeof(Sprite)) as Sprite;
//					string fileName = Path.GetFileNameWithoutExtension (fileInfo.FullName);
//					DataSheetInfo info = null;
//					sheetInfoMap.TryGetValue (dir + "/" + fileName, out info);
//
//					char c = (char)System.Int32.Parse(fileName, System.Globalization.NumberStyles.HexNumber);
//
//					SpriteInfo spriteInfo = new SpriteInfo();
//					spriteInfo.pivod = info.pivot;
//					spriteInfo.rect = info.rect;
//					spriteInfo.padding = MaterialTextureForETC1.getSpritePadding(spriteInfo.pivod, spriteInfo.rect, oldSprite.rect);
//
//					emojiInfo.infoMap.Add(c, spriteInfo);
//				}
//
//
//				MemoryStream stream = new MemoryStream();
//				BinaryWriter writer = new BinaryWriter(stream);
//				emojiInfo.Write(writer);
//
//				string fontPath = destPath + "/" + dir + ".bytes";
//				CommonUtil.bytesToFile(fontPath, stream.ToArray());
//
//				if(ExportAssetBundles.createJson)
//				{
//					string str = JsonConvert.SerializeObject(emojiInfo, Formatting.Indented);
//					CommonUtil.stringToFile(destPath + "/" + dir + ".json", str);
//				}
//			}
//		}
//
//		AssetDatabase.Refresh();
//	}

//	[MenuItem("Custom/OldProject/ImageFont/CreateEmojiConfig")]
	static void CreateEmojiConfig()
	{
//		CreateEmojiConfig2 ("", "");
//		CreateEmojiConfig2 (Platform.android.ToString(), "/");
//		CreateEmojiConfig2 (Platform.ios.ToString(), "/");
	}

//	[MenuItem("Custom/OldProject/ImageFont/CreateImageFont")]
	static void CreateImageFont2()
	{
		CreateImageFont3 ("", "");
//		CreateImageFont3 (Platform.android.ToString(), "/");
//		CreateImageFont3 (Platform.ios.ToString(), "/");
	}

	[MenuItem("Custom/OldProject/ImageFont/CreateEmojiImageSprite")]
	static void CreateEmojiImageSprite()
	{
		int gw = 32;
		int gh = 32;
		string srcPath = "Assets/Emoji/sheet_apple_16.png";
		string dirPath = Path.GetDirectoryName(srcPath) + "/" + Path.GetFileNameWithoutExtension(srcPath) + "/";
		Directory.CreateDirectory(dirPath);
		Texture2D tex = AssetDatabase.LoadAssetAtPath(srcPath, typeof(Texture2D)) as Texture2D;
		tex.filterMode = FilterMode.Point;
		Dictionary<char, Vector2>.Enumerator enumerator = emojiTable.GetEnumerator();
		while(enumerator.MoveNext())
		{
			int x = (int)enumerator.Current.Value.x;
			int y = (int)enumerator.Current.Value.y;
			string newFileName = string.Format("{0:x4}", (int)enumerator.Current.Key);
			if(newFileName.Length != 4)
			{
				Debug.Log("len: " + newFileName.Length);
				break;
			}

			Texture2D newTex = new Texture2D(gw, gh, UnityEngine.TextureFormat.RGBA32, false);
			for(int i = 0; i < gw; i++)
			{
				for(int j = 0; j < gh; j++)
				{
					Color c = tex.GetPixel(x * gw + i, (tex.height / gh - y - 1) * gh + j);
					newTex.SetPixel(i, j, c);
				}
			}
			byte[] data = newTex.EncodeToPNG();
			CommonUtil.bytesToFile(dirPath + newFileName + ".png", data);
		}

		AssetDatabase.Refresh();
	}
    private class EmojiJsonInfo
    {
        public string image;
        public int sheet_x;
        public int sheet_y;

    }
    [MenuItem("Custom/OldProject/ImageFont/CreateEmojiImageSprite2")]
    static void CreateEmojiImageSprite2()
    {
        //通过读取github项目的json 直接生成小图
        int gw = 32;
        int gh = 32;
        string srcPath = "Assets/Emoji/sheet_apple_32.png";
        string jsonPath = "Assets/Emoji/emoji_pretty.json.txt";
        string dirPath = Path.GetDirectoryName(srcPath) + "/" + Path.GetFileNameWithoutExtension(srcPath) + "/";
        Directory.CreateDirectory(dirPath);

        string jsonData = File.ReadAllText(jsonPath);
        List<EmojiJsonInfo> emojiDataList = JsonConvert.DeserializeObject<List<EmojiJsonInfo>>(jsonData);
        Texture2D tex = AssetDatabase.LoadAssetAtPath(srcPath, typeof(Texture2D)) as Texture2D;
        tex.filterMode = FilterMode.Point;
        for (int m = 0; m < emojiDataList.Count;m++ )
        {
            EmojiJsonInfo emojiData = emojiDataList[m];
            int x = emojiData.sheet_x;
            int y = emojiData.sheet_y;

            string newFileName = emojiData.image.ToLower();
            if (newFileName.Length == 9 && newFileName.StartsWith("1f"))
            {
                newFileName = newFileName.Substring(1);
            }
            if (newFileName.Length != 8)
            {
                //Debug.Log("len: " + newFileName.Length);
                continue;
            }

            Texture2D newTex = new Texture2D(gw, gh, UnityEngine.TextureFormat.RGBA32, false);
            for (int i = 0; i < gw; i++)
            {
                for (int j = 0; j < gh; j++)
                {
                    Color c = tex.GetPixel(x * gw + i, (tex.height / gh - y - 1) * gh + j);
                    newTex.SetPixel(i, j, c);
                }
            }
            byte[] data = newTex.EncodeToPNG();
            CommonUtil.bytesToFile(dirPath + newFileName, data);
                
        }

        AssetDatabase.Refresh();
    }
	/**
     *  这里的key 是 unified去掉第17位
     *  emoji字符串用utf32 编码获取char，char的值就是这个key
     *  
     * 目前只支持1f开头、00开头的编码
     * 编码类似1F1F0-1F1F3、0023-20E3 这种还未支持 
     * 
     * 数据参考：
     * https://github.com/iamcal/emoji-data
     * http://unicodey.com/emoji-data/table.htm
     */
	//  x = 列 y =行 
	public static Dictionary<char, Vector2> emojiTable = new Dictionary<char, Vector2>() { 
		{'\u00A9',new Vector2(0, 0)},
		{'\u00AE',new Vector2(0, 1)},
		{'\u203C',new Vector2(0, 2)},
		{'\u2049',new Vector2(0, 3)},
		{'\u2122',new Vector2(0, 4)},
		{'\u2139',new Vector2(0, 5)},
		{'\u2194',new Vector2(0, 6)},
		{'\u2195',new Vector2(0, 7)},
		{'\u2196',new Vector2(0, 8)},
		{'\u2197',new Vector2(0, 9)},
		{'\u2198',new Vector2(0, 10)},
		{'\u2199',new Vector2(0, 11)},
		{'\u21A9',new Vector2(0, 12)},
		{'\u21AA',new Vector2(0, 13)},
		{'\u231A',new Vector2(0, 14)},
		{'\u231B',new Vector2(0, 15)},
		{'\u23E9',new Vector2(0, 16)},
		{'\u23EA',new Vector2(0, 17)},
		{'\u23EB',new Vector2(0, 18)},
		{'\u23EC',new Vector2(0, 19)},
		{'\u23F0',new Vector2(0, 20)},
		{'\u23F3',new Vector2(0, 21)},
		{'\u24C2',new Vector2(0, 22)},
		{'\u25AA',new Vector2(0, 23)},
		{'\u25AB',new Vector2(0, 24)},
		{'\u25B6',new Vector2(0, 25)},
		{'\u25C0',new Vector2(0, 26)},
		{'\u25FB',new Vector2(0, 27)},
		{'\u25FC',new Vector2(0, 28)},
		{'\u25FD',new Vector2(0, 29)},
		{'\u25FE',new Vector2(0, 30)},
		{'\u2600',new Vector2(0, 31)},
		{'\u2601',new Vector2(0, 32)},
		{'\u260E',new Vector2(0, 33)},
		{'\u2611',new Vector2(0, 34)},
		{'\u2614',new Vector2(0, 35)},
		{'\u2615',new Vector2(0, 36)},
		{'\u261D',new Vector2(0, 37)},
		{'\u263A',new Vector2(1, 5)},
		{'\u2648',new Vector2(1, 6)},
		{'\u2649',new Vector2(1, 7)},
		{'\u264A',new Vector2(1, 8)},
		{'\u264B',new Vector2(1, 9)},
		{'\u264C',new Vector2(1, 10)},
		{'\u264D',new Vector2(1, 11)},
		{'\u264E',new Vector2(1, 12)},
		{'\u264F',new Vector2(1, 13)},
		{'\u2650',new Vector2(1, 14)},
		{'\u2651',new Vector2(1, 15)},
		{'\u2652',new Vector2(1, 16)},
		{'\u2653',new Vector2(1, 17)},
		{'\u2660',new Vector2(1, 18)},
		{'\u2663',new Vector2(1, 19)},
		{'\u2665',new Vector2(1, 20)},
		{'\u2666',new Vector2(1, 21)},
		{'\u2668',new Vector2(1, 22)},
		{'\u267B',new Vector2(1, 23)},
		{'\u267F',new Vector2(1, 24)},
		{'\u2693',new Vector2(1, 25)},
		{'\u26A0',new Vector2(1, 26)},
		{'\u26A1',new Vector2(1, 27)},
		{'\u26AA',new Vector2(1, 28)},
		{'\u26AB',new Vector2(1, 29)},
		{'\u26BD',new Vector2(1, 30)},
		{'\u26BE',new Vector2(1, 31)},
		{'\u26C4',new Vector2(1, 32)},
		{'\u26C5',new Vector2(1, 33)},
		{'\u26CE',new Vector2(1, 34)},
		{'\u26D4',new Vector2(1, 35)},
		{'\u26EA',new Vector2(1, 36)},
		{'\u26F2',new Vector2(1, 37)},
		{'\u26F3',new Vector2(2, 0)},
		{'\u26F5',new Vector2(2, 1)},
		{'\u26FA',new Vector2(2, 2)},
		{'\u26FD',new Vector2(2, 3)},
		{'\u2702',new Vector2(2, 4)},
		{'\u2705',new Vector2(2, 5)},
		{'\u2708',new Vector2(2, 6)},
		{'\u2709',new Vector2(2, 7)},
		{'\u270A',new Vector2(2, 8)},
		{'\u270B',new Vector2(2, 14)},
		{'\u270C',new Vector2(2, 20)},
		{'\u270F',new Vector2(2, 26)},
		{'\u2712',new Vector2(2, 27)},
		{'\u2714',new Vector2(2, 28)},
		{'\u2716',new Vector2(2, 29)},
		{'\u2728',new Vector2(2, 30)},
		{'\u2733',new Vector2(2, 31)},
		{'\u2734',new Vector2(2, 32)},
		{'\u2744',new Vector2(2, 33)},
		{'\u2747',new Vector2(2, 34)},
		{'\u274C',new Vector2(2, 35)},
		{'\u274E',new Vector2(2, 36)},
		{'\u2753',new Vector2(2, 37)},
		{'\u2754',new Vector2(3, 0)},
		{'\u2755',new Vector2(3, 1)},
		{'\u2757',new Vector2(3, 2)},
		{'\u2764',new Vector2(3, 3)},
		{'\u2795',new Vector2(3, 4)},
		{'\u2796',new Vector2(3, 5)},
		{'\u2797',new Vector2(3, 6)},
		{'\u27A1',new Vector2(3, 7)},
		{'\u27B0',new Vector2(3, 8)},
		{'\u27BF',new Vector2(3, 9)},
		{'\u2934',new Vector2(3, 10)},
		{'\u2935',new Vector2(3, 11)},
		{'\u2B05',new Vector2(3, 12)},
		{'\u2B06',new Vector2(3, 13)},
		{'\u2B07',new Vector2(3, 14)},
		{'\u2B1B',new Vector2(3, 15)},
		{'\u2B1C',new Vector2(3, 16)},
		{'\u2B50',new Vector2(3, 17)},
		{'\u2B55',new Vector2(3, 18)},
		{'\u3030',new Vector2(3, 19)},
		{'\u303D',new Vector2(3, 20)},
		{'\u3297',new Vector2(3, 21)},
		{'\u3299',new Vector2(3, 22)},
		{'\uF004',new Vector2(3, 23)},
		{'\uF0CF',new Vector2(3, 24)},
		{'\uF170',new Vector2(3, 25)},
		{'\uF171',new Vector2(3, 26)},
		{'\uF17E',new Vector2(3, 27)},
		{'\uF17F',new Vector2(3, 28)},
		{'\uF18E',new Vector2(3, 29)},
		{'\uF191',new Vector2(3, 30)},
		{'\uF192',new Vector2(3, 31)},
		{'\uF193',new Vector2(3, 32)},
		{'\uF194',new Vector2(3, 33)},
		{'\uF195',new Vector2(3, 34)},
		{'\uF196',new Vector2(3, 35)},
		{'\uF197',new Vector2(3, 36)},
		{'\uF198',new Vector2(3, 37)},
		{'\uF199',new Vector2(4, 0)},
		{'\uF19A',new Vector2(4, 1)},
		{'\uF201',new Vector2(4, 2)},
		{'\uF202',new Vector2(4, 3)},
		{'\uF21A',new Vector2(4, 4)},
		{'\uF22F',new Vector2(4, 5)},
		{'\uF232',new Vector2(4, 6)},
		{'\uF233',new Vector2(4, 7)},
		{'\uF234',new Vector2(4, 8)},
		{'\uF235',new Vector2(4, 9)},
		{'\uF236',new Vector2(4, 10)},
		{'\uF237',new Vector2(4, 11)},
		{'\uF238',new Vector2(4, 12)},
		{'\uF239',new Vector2(4, 13)},
		{'\uF23A',new Vector2(4, 14)},
		{'\uF250',new Vector2(4, 15)},
		{'\uF251',new Vector2(4, 16)},
		{'\uF300',new Vector2(4, 17)},
		{'\uF301',new Vector2(4, 18)},
		{'\uF302',new Vector2(4, 19)},
		{'\uF303',new Vector2(4, 20)},
		{'\uF304',new Vector2(4, 21)},
		{'\uF305',new Vector2(4, 22)},
		{'\uF306',new Vector2(4, 23)},
		{'\uF307',new Vector2(4, 24)},
		{'\uF308',new Vector2(4, 25)},
		{'\uF309',new Vector2(4, 26)},
		{'\uF30A',new Vector2(4, 27)},
		{'\uF30B',new Vector2(4, 28)},
		{'\uF30C',new Vector2(4, 29)},
		{'\uF30D',new Vector2(4, 30)},
		{'\uF30E',new Vector2(4, 31)},
		{'\uF30F',new Vector2(4, 32)},
		{'\uF310',new Vector2(4, 33)},
		{'\uF311',new Vector2(4, 34)},
		{'\uF312',new Vector2(4, 35)},
		{'\uF313',new Vector2(4, 36)},
		{'\uF314',new Vector2(4, 37)},
		{'\uF315',new Vector2(5, 0)},
		{'\uF316',new Vector2(5, 1)},
		{'\uF317',new Vector2(5, 2)},
		{'\uF318',new Vector2(5, 3)},
		{'\uF319',new Vector2(5, 4)},
		{'\uF31A',new Vector2(5, 5)},
		{'\uF31B',new Vector2(5, 6)},
		{'\uF31C',new Vector2(5, 7)},
		{'\uF31D',new Vector2(5, 8)},
		{'\uF31E',new Vector2(5, 9)},
		{'\uF31F',new Vector2(5, 10)},
		{'\uF320',new Vector2(5, 11)},
		{'\uF330',new Vector2(5, 12)},
		{'\uF331',new Vector2(5, 13)},
		{'\uF332',new Vector2(5, 14)},
		{'\uF333',new Vector2(5, 15)},
		{'\uF334',new Vector2(5, 16)},
		{'\uF335',new Vector2(5, 17)},
		{'\uF337',new Vector2(5, 18)},
		{'\uF338',new Vector2(5, 19)},
		{'\uF339',new Vector2(5, 20)},
		{'\uF33A',new Vector2(5, 21)},
		{'\uF33B',new Vector2(5, 22)},
		{'\uF33C',new Vector2(5, 23)},
		{'\uF33D',new Vector2(5, 24)},
		{'\uF33E',new Vector2(5, 25)},
		{'\uF33F',new Vector2(5, 26)},
		{'\uF340',new Vector2(5, 27)},
		{'\uF341',new Vector2(5, 28)},
		{'\uF342',new Vector2(5, 29)},
		{'\uF343',new Vector2(5, 30)},
		{'\uF344',new Vector2(5, 31)},
		{'\uF345',new Vector2(5, 32)},
		{'\uF346',new Vector2(5, 33)},
		{'\uF347',new Vector2(5, 34)},
		{'\uF348',new Vector2(5, 35)},
		{'\uF349',new Vector2(5, 36)},
		{'\uF34A',new Vector2(5, 37)},
		{'\uF34B',new Vector2(6, 0)},
		{'\uF34C',new Vector2(6, 1)},
		{'\uF34D',new Vector2(6, 2)},
		{'\uF34E',new Vector2(6, 3)},
		{'\uF34F',new Vector2(6, 4)},
		{'\uF350',new Vector2(6, 5)},
		{'\uF351',new Vector2(6, 6)},
		{'\uF352',new Vector2(6, 7)},
		{'\uF353',new Vector2(6, 8)},
		{'\uF354',new Vector2(6, 9)},
		{'\uF355',new Vector2(6, 10)},
		{'\uF356',new Vector2(6, 11)},
		{'\uF357',new Vector2(6, 12)},
		{'\uF358',new Vector2(6, 13)},
		{'\uF359',new Vector2(6, 14)},
		{'\uF35A',new Vector2(6, 15)},
		{'\uF35B',new Vector2(6, 16)},
		{'\uF35C',new Vector2(6, 17)},
		{'\uF35D',new Vector2(6, 18)},
		{'\uF35E',new Vector2(6, 19)},
		{'\uF35F',new Vector2(6, 20)},
		{'\uF360',new Vector2(6, 21)},
		{'\uF361',new Vector2(6, 22)},
		{'\uF362',new Vector2(6, 23)},
		{'\uF363',new Vector2(6, 24)},
		{'\uF364',new Vector2(6, 25)},
		{'\uF365',new Vector2(6, 26)},
		{'\uF366',new Vector2(6, 27)},
		{'\uF367',new Vector2(6, 28)},
		{'\uF368',new Vector2(6, 29)},
		{'\uF369',new Vector2(6, 30)},
		{'\uF36A',new Vector2(6, 31)},
		{'\uF36B',new Vector2(6, 32)},
		{'\uF36C',new Vector2(6, 33)},
		{'\uF36D',new Vector2(6, 34)},
		{'\uF36E',new Vector2(6, 35)},
		{'\uF36F',new Vector2(6, 36)},
		{'\uF370',new Vector2(6, 37)},
		{'\uF371',new Vector2(7, 0)},
		{'\uF372',new Vector2(7, 1)},
		{'\uF373',new Vector2(7, 2)},
		{'\uF374',new Vector2(7, 3)},
		{'\uF375',new Vector2(7, 4)},
		{'\uF376',new Vector2(7, 5)},
		{'\uF377',new Vector2(7, 6)},
		{'\uF378',new Vector2(7, 7)},
		{'\uF379',new Vector2(7, 8)},
		{'\uF37A',new Vector2(7, 9)},
		{'\uF37B',new Vector2(7, 10)},
		{'\uF37C',new Vector2(7, 11)},
		{'\uF380',new Vector2(7, 12)},
		{'\uF381',new Vector2(7, 13)},
		{'\uF382',new Vector2(7, 14)},
		{'\uF383',new Vector2(7, 15)},
		{'\uF384',new Vector2(7, 16)},
		{'\uF385',new Vector2(7, 17)},
		{'\uF386',new Vector2(7, 23)},
		{'\uF387',new Vector2(7, 24)},
		{'\uF388',new Vector2(7, 25)},
		{'\uF389',new Vector2(7, 26)},
		{'\uF38A',new Vector2(7, 27)},
		{'\uF38B',new Vector2(7, 28)},
		{'\uF38C',new Vector2(7, 29)},
		{'\uF38D',new Vector2(7, 30)},
		{'\uF38E',new Vector2(7, 31)},
		{'\uF38F',new Vector2(7, 32)},
		{'\uF390',new Vector2(7, 33)},
		{'\uF391',new Vector2(7, 34)},
		{'\uF392',new Vector2(7, 35)},
		{'\uF393',new Vector2(7, 36)},
		{'\uF3A0',new Vector2(7, 37)},
		{'\uF3A1',new Vector2(8, 0)},
		{'\uF3A2',new Vector2(8, 1)},
		{'\uF3A3',new Vector2(8, 2)},
		{'\uF3A4',new Vector2(8, 3)},
		{'\uF3A5',new Vector2(8, 4)},
		{'\uF3A6',new Vector2(8, 5)},
		{'\uF3A7',new Vector2(8, 6)},
		{'\uF3A8',new Vector2(8, 7)},
		{'\uF3A9',new Vector2(8, 8)},
		{'\uF3AA',new Vector2(8, 9)},
		{'\uF3AB',new Vector2(8, 10)},
		{'\uF3AC',new Vector2(8, 11)},
		{'\uF3AD',new Vector2(8, 12)},
		{'\uF3AE',new Vector2(8, 13)},
		{'\uF3AF',new Vector2(8, 14)},
		{'\uF3B0',new Vector2(8, 15)},
		{'\uF3B1',new Vector2(8, 16)},
		{'\uF3B2',new Vector2(8, 17)},
		{'\uF3B3',new Vector2(8, 18)},
		{'\uF3B4',new Vector2(8, 19)},
		{'\uF3B5',new Vector2(8, 20)},
		{'\uF3B6',new Vector2(8, 21)},
		{'\uF3B7',new Vector2(8, 22)},
		{'\uF3B8',new Vector2(8, 23)},
		{'\uF3B9',new Vector2(8, 24)},
		{'\uF3BA',new Vector2(8, 25)},
		{'\uF3BB',new Vector2(8, 26)},
		{'\uF3BC',new Vector2(8, 27)},
		{'\uF3BD',new Vector2(8, 28)},
		{'\uF3BE',new Vector2(8, 29)},
		{'\uF3BF',new Vector2(8, 30)},
		{'\uF3C0',new Vector2(8, 31)},
		{'\uF3C1',new Vector2(8, 32)},
		{'\uF3C2',new Vector2(8, 33)},
		{'\uF3C3',new Vector2(8, 34)},
		{'\uF3C4',new Vector2(9, 2)},
		{'\uF3C6',new Vector2(9, 8)},
		{'\uF3C7',new Vector2(9, 9)},
		{'\uF3C8',new Vector2(9, 15)},
		{'\uF3C9',new Vector2(9, 16)},
		{'\uF3CA',new Vector2(9, 17)},
		{'\uF3E0',new Vector2(9, 23)},
		{'\uF3E1',new Vector2(9, 24)},
		{'\uF3E2',new Vector2(9, 25)},
		{'\uF3E3',new Vector2(9, 26)},
		{'\uF3E4',new Vector2(9, 27)},
		{'\uF3E5',new Vector2(9, 28)},
		{'\uF3E6',new Vector2(9, 29)},
		{'\uF3E7',new Vector2(9, 30)},
		{'\uF3E8',new Vector2(9, 31)},
		{'\uF3E9',new Vector2(9, 32)},
		{'\uF3EA',new Vector2(9, 33)},
		{'\uF3EB',new Vector2(9, 34)},
		{'\uF3EC',new Vector2(9, 35)},
		{'\uF3ED',new Vector2(9, 36)},
		{'\uF3EE',new Vector2(9, 37)},
		{'\uF3EF',new Vector2(10, 0)},
		{'\uF3F0',new Vector2(10, 1)},
		{'\uF3FB',new Vector2(10, 2)},
		{'\uF3FC',new Vector2(10, 3)},
		{'\uF3FD',new Vector2(10, 4)},
		{'\uF3FE',new Vector2(10, 5)},
		{'\uF3FF',new Vector2(10, 6)},
		{'\uF400',new Vector2(10, 7)},
		{'\uF401',new Vector2(10, 8)},
		{'\uF402',new Vector2(10, 9)},
		{'\uF403',new Vector2(10, 10)},
		{'\uF404',new Vector2(10, 11)},
		{'\uF405',new Vector2(10, 12)},
		{'\uF406',new Vector2(10, 13)},
		{'\uF407',new Vector2(10, 14)},
		{'\uF408',new Vector2(10, 15)},
		{'\uF409',new Vector2(10, 16)},
		{'\uF40A',new Vector2(10, 17)},
		{'\uF40B',new Vector2(10, 18)},
		{'\uF40C',new Vector2(10, 19)},
		{'\uF40D',new Vector2(10, 20)},
		{'\uF40E',new Vector2(10, 21)},
		{'\uF40F',new Vector2(10, 22)},
		{'\uF410',new Vector2(10, 23)},
		{'\uF411',new Vector2(10, 24)},
		{'\uF412',new Vector2(10, 25)},
		{'\uF413',new Vector2(10, 26)},
		{'\uF414',new Vector2(10, 27)},
		{'\uF415',new Vector2(10, 28)},
		{'\uF416',new Vector2(10, 29)},
		{'\uF417',new Vector2(10, 30)},
		{'\uF418',new Vector2(10, 31)},
		{'\uF419',new Vector2(10, 32)},
		{'\uF41A',new Vector2(10, 33)},
		{'\uF41B',new Vector2(10, 34)},
		{'\uF41C',new Vector2(10, 35)},
		{'\uF41D',new Vector2(10, 36)},
		{'\uF41E',new Vector2(10, 37)},
		{'\uF41F',new Vector2(11, 0)},
		{'\uF420',new Vector2(11, 1)},
		{'\uF421',new Vector2(11, 2)},
		{'\uF422',new Vector2(11, 3)},
		{'\uF423',new Vector2(11, 4)},
		{'\uF424',new Vector2(11, 5)},
		{'\uF425',new Vector2(11, 6)},
		{'\uF426',new Vector2(11, 7)},
		{'\uF427',new Vector2(11, 8)},
		{'\uF428',new Vector2(11, 9)},
		{'\uF429',new Vector2(11, 10)},
		{'\uF42A',new Vector2(11, 11)},
		{'\uF42B',new Vector2(11, 12)},
		{'\uF42C',new Vector2(11, 13)},
		{'\uF42D',new Vector2(11, 14)},
		{'\uF42E',new Vector2(11, 15)},
		{'\uF42F',new Vector2(11, 16)},
		{'\uF430',new Vector2(11, 17)},
		{'\uF431',new Vector2(11, 18)},
		{'\uF432',new Vector2(11, 19)},
		{'\uF433',new Vector2(11, 20)},
		{'\uF434',new Vector2(11, 21)},
		{'\uF435',new Vector2(11, 22)},
		{'\uF436',new Vector2(11, 23)},
		{'\uF437',new Vector2(11, 24)},
		{'\uF438',new Vector2(11, 25)},
		{'\uF439',new Vector2(11, 26)},
		{'\uF43A',new Vector2(11, 27)},
		{'\uF43B',new Vector2(11, 28)},
		{'\uF43C',new Vector2(11, 29)},
		{'\uF43D',new Vector2(11, 30)},
		{'\uF43E',new Vector2(11, 31)},
		{'\uF440',new Vector2(11, 32)},
		{'\uF442',new Vector2(11, 33)},
		{'\uF443',new Vector2(12, 1)},
		{'\uF444',new Vector2(12, 7)},
		{'\uF445',new Vector2(12, 8)},
		{'\uF446',new Vector2(12, 9)},
		{'\uF447',new Vector2(12, 15)},
		{'\uF448',new Vector2(12, 21)},
		{'\uF449',new Vector2(12, 27)},
		{'\uF44A',new Vector2(12, 33)},
		{'\uF44B',new Vector2(13, 1)},
		{'\uF44C',new Vector2(13, 7)},
		{'\uF44D',new Vector2(13, 13)},
		{'\uF44E',new Vector2(13, 19)},
		{'\uF44F',new Vector2(13, 25)},
		{'\uF450',new Vector2(13, 31)},
		{'\uF451',new Vector2(13, 37)},
		{'\uF452',new Vector2(14, 0)},
		{'\uF453',new Vector2(14, 1)},
		{'\uF454',new Vector2(14, 2)},
		{'\uF455',new Vector2(14, 3)},
		{'\uF456',new Vector2(14, 4)},
		{'\uF457',new Vector2(14, 5)},
		{'\uF458',new Vector2(14, 6)},
		{'\uF459',new Vector2(14, 7)},
		{'\uF45A',new Vector2(14, 8)},
		{'\uF45B',new Vector2(14, 9)},
		{'\uF45C',new Vector2(14, 10)},
		{'\uF45D',new Vector2(14, 11)},
		{'\uF45E',new Vector2(14, 12)},
		{'\uF45F',new Vector2(14, 13)},
		{'\uF460',new Vector2(14, 14)},
		{'\uF461',new Vector2(14, 15)},
		{'\uF462',new Vector2(14, 16)},
		{'\uF463',new Vector2(14, 17)},
		{'\uF464',new Vector2(14, 18)},
		{'\uF465',new Vector2(14, 19)},
		{'\uF466',new Vector2(14, 20)},
		{'\uF467',new Vector2(14, 26)},
		{'\uF468',new Vector2(14, 32)},
		{'\uF469',new Vector2(15, 0)},
		{'\uF46A',new Vector2(15, 6)},
		{'\uF46B',new Vector2(15, 7)},
		{'\uF46C',new Vector2(15, 8)},
		{'\uF46D',new Vector2(15, 9)},
		{'\uF46E',new Vector2(15, 10)},
		{'\uF46F',new Vector2(15, 16)},
		{'\uF470',new Vector2(15, 17)},
		{'\uF471',new Vector2(15, 23)},
		{'\uF472',new Vector2(15, 29)},
		{'\uF473',new Vector2(15, 35)},
		{'\uF474',new Vector2(16, 3)},
		{'\uF475',new Vector2(16, 9)},
		{'\uF476',new Vector2(16, 15)},
		{'\uF477',new Vector2(16, 21)},
		{'\uF478',new Vector2(16, 27)},
		{'\uF479',new Vector2(16, 33)},
		{'\uF47A',new Vector2(16, 34)},
		{'\uF47B',new Vector2(16, 35)},
		{'\uF47C',new Vector2(16, 36)},
		{'\uF47D',new Vector2(17, 4)},
		{'\uF47E',new Vector2(17, 5)},
		{'\uF47F',new Vector2(17, 6)},
		{'\uF480',new Vector2(17, 7)},
		{'\uF481',new Vector2(17, 8)},
		{'\uF482',new Vector2(17, 14)},
		{'\uF483',new Vector2(17, 20)},
		{'\uF484',new Vector2(17, 26)},
		{'\uF485',new Vector2(17, 27)},
		{'\uF486',new Vector2(17, 33)},
		{'\uF487',new Vector2(18, 1)},
		{'\uF488',new Vector2(18, 7)},
		{'\uF489',new Vector2(18, 8)},
		{'\uF48A',new Vector2(18, 9)},
		{'\uF48B',new Vector2(18, 10)},
		{'\uF48C',new Vector2(18, 11)},
		{'\uF48D',new Vector2(18, 12)},
		{'\uF48E',new Vector2(18, 13)},
		{'\uF48F',new Vector2(18, 14)},
		{'\uF490',new Vector2(18, 15)},
		{'\uF491',new Vector2(18, 16)},
		{'\uF492',new Vector2(18, 17)},
		{'\uF493',new Vector2(18, 18)},
		{'\uF494',new Vector2(18, 19)},
		{'\uF495',new Vector2(18, 20)},
		{'\uF496',new Vector2(18, 21)},
		{'\uF497',new Vector2(18, 22)},
		{'\uF498',new Vector2(18, 23)},
		{'\uF499',new Vector2(18, 24)},
		{'\uF49A',new Vector2(18, 25)},
		{'\uF49B',new Vector2(18, 26)},
		{'\uF49C',new Vector2(18, 27)},
		{'\uF49D',new Vector2(18, 28)},
		{'\uF49E',new Vector2(18, 29)},
		{'\uF49F',new Vector2(18, 30)},
		{'\uF4A0',new Vector2(18, 31)},
		{'\uF4A1',new Vector2(18, 32)},
		{'\uF4A2',new Vector2(18, 33)},
		{'\uF4A3',new Vector2(18, 34)},
		{'\uF4A4',new Vector2(18, 35)},
		{'\uF4A5',new Vector2(18, 36)},
		{'\uF4A6',new Vector2(18, 37)},
		{'\uF4A7',new Vector2(19, 0)},
		{'\uF4A8',new Vector2(19, 1)},
		{'\uF4A9',new Vector2(19, 2)},
		{'\uF4AA',new Vector2(19, 3)},
		{'\uF4AB',new Vector2(19, 9)},
		{'\uF4AC',new Vector2(19, 10)},
		{'\uF4AD',new Vector2(19, 11)},
		{'\uF4AE',new Vector2(19, 12)},
		{'\uF4AF',new Vector2(19, 13)},
		{'\uF4B0',new Vector2(19, 14)},
		{'\uF4B1',new Vector2(19, 15)},
		{'\uF4B2',new Vector2(19, 16)},
		{'\uF4B3',new Vector2(19, 17)},
		{'\uF4B4',new Vector2(19, 18)},
		{'\uF4B5',new Vector2(19, 19)},
		{'\uF4B6',new Vector2(19, 20)},
		{'\uF4B7',new Vector2(19, 21)},
		{'\uF4B8',new Vector2(19, 22)},
		{'\uF4B9',new Vector2(19, 23)},
		{'\uF4BA',new Vector2(19, 24)},
		{'\uF4BB',new Vector2(19, 25)},
		{'\uF4BC',new Vector2(19, 26)},
		{'\uF4BD',new Vector2(19, 27)},
		{'\uF4BE',new Vector2(19, 28)},
		{'\uF4BF',new Vector2(19, 29)},
		{'\uF4C0',new Vector2(19, 30)},
		{'\uF4C1',new Vector2(19, 31)},
		{'\uF4C2',new Vector2(19, 32)},
		{'\uF4C3',new Vector2(19, 33)},
		{'\uF4C4',new Vector2(19, 34)},
		{'\uF4C5',new Vector2(19, 35)},
		{'\uF4C6',new Vector2(19, 36)},
		{'\uF4C7',new Vector2(19, 37)},
		{'\uF4C8',new Vector2(20, 0)},
		{'\uF4C9',new Vector2(20, 1)},
		{'\uF4CA',new Vector2(20, 2)},
		{'\uF4CB',new Vector2(20, 3)},
		{'\uF4CC',new Vector2(20, 4)},
		{'\uF4CD',new Vector2(20, 5)},
		{'\uF4CE',new Vector2(20, 6)},
		{'\uF4CF',new Vector2(20, 7)},
		{'\uF4D0',new Vector2(20, 8)},
		{'\uF4D1',new Vector2(20, 9)},
		{'\uF4D2',new Vector2(20, 10)},
		{'\uF4D3',new Vector2(20, 11)},
		{'\uF4D4',new Vector2(20, 12)},
		{'\uF4D5',new Vector2(20, 13)},
		{'\uF4D6',new Vector2(20, 14)},
		{'\uF4D7',new Vector2(20, 15)},
		{'\uF4D8',new Vector2(20, 16)},
		{'\uF4D9',new Vector2(20, 17)},
		{'\uF4DA',new Vector2(20, 18)},
		{'\uF4DB',new Vector2(20, 19)},
		{'\uF4DC',new Vector2(20, 20)},
		{'\uF4DD',new Vector2(20, 21)},
		{'\uF4DE',new Vector2(20, 22)},
		{'\uF4DF',new Vector2(20, 23)},
		{'\uF4E0',new Vector2(20, 24)},
		{'\uF4E1',new Vector2(20, 25)},
		{'\uF4E2',new Vector2(20, 26)},
		{'\uF4E3',new Vector2(20, 27)},
		{'\uF4E4',new Vector2(20, 28)},
		{'\uF4E5',new Vector2(20, 29)},
		{'\uF4E6',new Vector2(20, 30)},
		{'\uF4E7',new Vector2(20, 31)},
		{'\uF4E8',new Vector2(20, 32)},
		{'\uF4E9',new Vector2(20, 33)},
		{'\uF4EA',new Vector2(20, 34)},
		{'\uF4EB',new Vector2(20, 35)},
		{'\uF4EC',new Vector2(20, 36)},
		{'\uF4ED',new Vector2(20, 37)},
		{'\uF4EE',new Vector2(21, 0)},
		{'\uF4EF',new Vector2(21, 1)},
		{'\uF4F0',new Vector2(21, 2)},
		{'\uF4F1',new Vector2(21, 3)},
		{'\uF4F2',new Vector2(21, 4)},
		{'\uF4F3',new Vector2(21, 5)},
		{'\uF4F4',new Vector2(21, 6)},
		{'\uF4F5',new Vector2(21, 7)},
		{'\uF4F6',new Vector2(21, 8)},
		{'\uF4F7',new Vector2(21, 9)},
		{'\uF4F9',new Vector2(21, 10)},
		{'\uF4FA',new Vector2(21, 11)},
		{'\uF4FB',new Vector2(21, 12)},
		{'\uF4FC',new Vector2(21, 13)},
		{'\uF500',new Vector2(21, 14)},
		{'\uF501',new Vector2(21, 15)},
		{'\uF502',new Vector2(21, 16)},
		{'\uF503',new Vector2(21, 17)},
		{'\uF504',new Vector2(21, 18)},
		{'\uF505',new Vector2(21, 19)},
		{'\uF506',new Vector2(21, 20)},
		{'\uF507',new Vector2(21, 21)},
		{'\uF508',new Vector2(21, 22)},
		{'\uF509',new Vector2(21, 23)},
		{'\uF50A',new Vector2(21, 24)},
		{'\uF50B',new Vector2(21, 25)},
		{'\uF50C',new Vector2(21, 26)},
		{'\uF50D',new Vector2(21, 27)},
		{'\uF50E',new Vector2(21, 28)},
		{'\uF50F',new Vector2(21, 29)},
		{'\uF510',new Vector2(21, 30)},
		{'\uF511',new Vector2(21, 31)},
		{'\uF512',new Vector2(21, 32)},
		{'\uF513',new Vector2(21, 33)},
		{'\uF514',new Vector2(21, 34)},
		{'\uF515',new Vector2(21, 35)},
		{'\uF516',new Vector2(21, 36)},
		{'\uF517',new Vector2(21, 37)},
		{'\uF518',new Vector2(22, 0)},
		{'\uF519',new Vector2(22, 1)},
		{'\uF51A',new Vector2(22, 2)},
		{'\uF51B',new Vector2(22, 3)},
		{'\uF51C',new Vector2(22, 4)},
		{'\uF51D',new Vector2(22, 5)},
		{'\uF51E',new Vector2(22, 6)},
		{'\uF51F',new Vector2(22, 7)},
		{'\uF520',new Vector2(22, 8)},
		{'\uF521',new Vector2(22, 9)},
		{'\uF522',new Vector2(22, 10)},
		{'\uF523',new Vector2(22, 11)},
		{'\uF524',new Vector2(22, 12)},
		{'\uF525',new Vector2(22, 13)},
		{'\uF526',new Vector2(22, 14)},
		{'\uF527',new Vector2(22, 15)},
		{'\uF528',new Vector2(22, 16)},
		{'\uF529',new Vector2(22, 17)},
		{'\uF52A',new Vector2(22, 18)},
		{'\uF52B',new Vector2(22, 19)},
		{'\uF52C',new Vector2(22, 20)},
		{'\uF52D',new Vector2(22, 21)},
		{'\uF52E',new Vector2(22, 22)},
		{'\uF52F',new Vector2(22, 23)},
		{'\uF530',new Vector2(22, 24)},
		{'\uF531',new Vector2(22, 25)},
		{'\uF532',new Vector2(22, 26)},
		{'\uF533',new Vector2(22, 27)},
		{'\uF534',new Vector2(22, 28)},
		{'\uF535',new Vector2(22, 29)},
		{'\uF536',new Vector2(22, 30)},
		{'\uF537',new Vector2(22, 31)},
		{'\uF538',new Vector2(22, 32)},
		{'\uF539',new Vector2(22, 33)},
		{'\uF53A',new Vector2(22, 34)},
		{'\uF53B',new Vector2(22, 35)},
		{'\uF53C',new Vector2(22, 36)},
		{'\uF53D',new Vector2(22, 37)},
		{'\uF550',new Vector2(23, 0)},
		{'\uF551',new Vector2(23, 1)},
		{'\uF552',new Vector2(23, 2)},
		{'\uF553',new Vector2(23, 3)},
		{'\uF554',new Vector2(23, 4)},
		{'\uF555',new Vector2(23, 5)},
		{'\uF556',new Vector2(23, 6)},
		{'\uF557',new Vector2(23, 7)},
		{'\uF558',new Vector2(23, 8)},
		{'\uF559',new Vector2(23, 9)},
		{'\uF55A',new Vector2(23, 10)},
		{'\uF55B',new Vector2(23, 11)},
		{'\uF55C',new Vector2(23, 12)},
		{'\uF55D',new Vector2(23, 13)},
		{'\uF55E',new Vector2(23, 14)},
		{'\uF55F',new Vector2(23, 15)},
		{'\uF560',new Vector2(23, 16)},
		{'\uF561',new Vector2(23, 17)},
		{'\uF562',new Vector2(23, 18)},
		{'\uF563',new Vector2(23, 19)},
		{'\uF564',new Vector2(23, 20)},
		{'\uF565',new Vector2(23, 21)},
		{'\uF566',new Vector2(23, 22)},
		{'\uF567',new Vector2(23, 23)},
		{'\uF596',new Vector2(23, 24)},
		{'\uF5FB',new Vector2(23, 30)},
		{'\uF5FC',new Vector2(23, 31)},
		{'\uF5FD',new Vector2(23, 32)},
		{'\uF5FE',new Vector2(23, 33)},
		{'\uF5FF',new Vector2(23, 34)},
		{'\uF600',new Vector2(23, 35)},
		{'\uF601',new Vector2(23, 36)},
		{'\uF602',new Vector2(23, 37)},
		{'\uF603',new Vector2(24, 0)},
		{'\uF604',new Vector2(24, 1)},
		{'\uF605',new Vector2(24, 2)},
		{'\uF606',new Vector2(24, 3)},
		{'\uF607',new Vector2(24, 4)},
		{'\uF608',new Vector2(24, 5)},
		{'\uF609',new Vector2(24, 6)},
		{'\uF60A',new Vector2(24, 7)},
		{'\uF60B',new Vector2(24, 8)},
		{'\uF60C',new Vector2(24, 9)},
		{'\uF60D',new Vector2(24, 10)},
		{'\uF60E',new Vector2(24, 11)},
		{'\uF60F',new Vector2(24, 12)},
		{'\uF610',new Vector2(24, 13)},
		{'\uF611',new Vector2(24, 14)},
		{'\uF612',new Vector2(24, 15)},
		{'\uF613',new Vector2(24, 16)},
		{'\uF614',new Vector2(24, 17)},
		{'\uF615',new Vector2(24, 18)},
		{'\uF616',new Vector2(24, 19)},
		{'\uF617',new Vector2(24, 20)},
		{'\uF618',new Vector2(24, 21)},
		{'\uF619',new Vector2(24, 22)},
		{'\uF61A',new Vector2(24, 23)},
		{'\uF61B',new Vector2(24, 24)},
		{'\uF61C',new Vector2(24, 25)},
		{'\uF61D',new Vector2(24, 26)},
		{'\uF61E',new Vector2(24, 27)},
		{'\uF61F',new Vector2(24, 28)},
		{'\uF620',new Vector2(24, 29)},
		{'\uF621',new Vector2(24, 30)},
		{'\uF622',new Vector2(24, 31)},
		{'\uF623',new Vector2(24, 32)},
		{'\uF624',new Vector2(24, 33)},
		{'\uF625',new Vector2(24, 34)},
		{'\uF626',new Vector2(24, 35)},
		{'\uF627',new Vector2(24, 36)},
		{'\uF628',new Vector2(24, 37)},
		{'\uF629',new Vector2(25, 0)},
		{'\uF62A',new Vector2(25, 1)},
		{'\uF62B',new Vector2(25, 2)},
		{'\uF62C',new Vector2(25, 3)},
		{'\uF62D',new Vector2(25, 4)},
		{'\uF62E',new Vector2(25, 5)},
		{'\uF62F',new Vector2(25, 6)},
		{'\uF630',new Vector2(25, 7)},
		{'\uF631',new Vector2(25, 8)},
		{'\uF632',new Vector2(25, 9)},
		{'\uF633',new Vector2(25, 10)},
		{'\uF634',new Vector2(25, 11)},
		{'\uF635',new Vector2(25, 12)},
		{'\uF636',new Vector2(25, 13)},
		{'\uF637',new Vector2(25, 14)},
		{'\uF638',new Vector2(25, 15)},
		{'\uF639',new Vector2(25, 16)},
		{'\uF63A',new Vector2(25, 17)},
		{'\uF63B',new Vector2(25, 18)},
		{'\uF63C',new Vector2(25, 19)},
		{'\uF63D',new Vector2(25, 20)},
		{'\uF63E',new Vector2(25, 21)},
		{'\uF63F',new Vector2(25, 22)},
		{'\uF640',new Vector2(25, 23)},
		{'\uF645',new Vector2(25, 24)},
		{'\uF646',new Vector2(25, 30)},
		{'\uF647',new Vector2(25, 36)},
		{'\uF648',new Vector2(26, 4)},
		{'\uF649',new Vector2(26, 5)},
		{'\uF64A',new Vector2(26, 6)},
		{'\uF64B',new Vector2(26, 7)},
		{'\uF64C',new Vector2(26, 13)},
		{'\uF64D',new Vector2(26, 19)},
		{'\uF64E',new Vector2(26, 25)},
		{'\uF64F',new Vector2(26, 31)},
		{'\uF680',new Vector2(26, 37)},
		{'\uF681',new Vector2(27, 0)},
		{'\uF682',new Vector2(27, 1)},
		{'\uF683',new Vector2(27, 2)},
		{'\uF684',new Vector2(27, 3)},
		{'\uF685',new Vector2(27, 4)},
		{'\uF686',new Vector2(27, 5)},
		{'\uF687',new Vector2(27, 6)},
		{'\uF688',new Vector2(27, 7)},
		{'\uF689',new Vector2(27, 8)},
		{'\uF68A',new Vector2(27, 9)},
		{'\uF68B',new Vector2(27, 10)},
		{'\uF68C',new Vector2(27, 11)},
		{'\uF68D',new Vector2(27, 12)},
		{'\uF68E',new Vector2(27, 13)},
		{'\uF68F',new Vector2(27, 14)},
		{'\uF690',new Vector2(27, 15)},
		{'\uF691',new Vector2(27, 16)},
		{'\uF692',new Vector2(27, 17)},
		{'\uF693',new Vector2(27, 18)},
		{'\uF694',new Vector2(27, 19)},
		{'\uF695',new Vector2(27, 20)},
		{'\uF696',new Vector2(27, 21)},
		{'\uF697',new Vector2(27, 22)},
		{'\uF698',new Vector2(27, 23)},
		{'\uF699',new Vector2(27, 24)},
		{'\uF69A',new Vector2(27, 25)},
		{'\uF69B',new Vector2(27, 26)},
		{'\uF69C',new Vector2(27, 27)},
		{'\uF69D',new Vector2(27, 28)},
		{'\uF69E',new Vector2(27, 29)},
		{'\uF69F',new Vector2(27, 30)},
		{'\uF6A0',new Vector2(27, 31)},
		{'\uF6A1',new Vector2(27, 32)},
		{'\uF6A2',new Vector2(27, 33)},
		{'\uF6A3',new Vector2(27, 34)},
		{'\uF6A4',new Vector2(28, 2)},
		{'\uF6A5',new Vector2(28, 3)},
		{'\uF6A6',new Vector2(28, 4)},
		{'\uF6A7',new Vector2(28, 5)},
		{'\uF6A8',new Vector2(28, 6)},
		{'\uF6A9',new Vector2(28, 7)},
		{'\uF6AA',new Vector2(28, 8)},
		{'\uF6AB',new Vector2(28, 9)},
		{'\uF6AC',new Vector2(28, 10)},
		{'\uF6AD',new Vector2(28, 11)},
		{'\uF6AE',new Vector2(28, 12)},
		{'\uF6AF',new Vector2(28, 13)},
		{'\uF6B0',new Vector2(28, 14)},
		{'\uF6B1',new Vector2(28, 15)},
		{'\uF6B2',new Vector2(28, 16)},
		{'\uF6B3',new Vector2(28, 17)},
		{'\uF6B4',new Vector2(28, 18)},
		{'\uF6B5',new Vector2(28, 24)},
		{'\uF6B6',new Vector2(28, 30)},
		{'\uF6B7',new Vector2(28, 36)},
		{'\uF6B8',new Vector2(28, 37)},
		{'\uF6B9',new Vector2(29, 0)},
		{'\uF6BA',new Vector2(29, 1)},
		{'\uF6BB',new Vector2(29, 2)},
		{'\uF6BC',new Vector2(29, 3)},
		{'\uF6BD',new Vector2(29, 4)},
		{'\uF6BE',new Vector2(29, 5)},
		{'\uF6BF',new Vector2(29, 6)},
		{'\uF6C0',new Vector2(29, 7)},
		{'\uF6C1',new Vector2(29, 13)},
		{'\uF6C2',new Vector2(29, 14)},
		{'\uF6C3',new Vector2(29, 15)},
		{'\uF6C4',new Vector2(29, 16)},
		{'\uF6C5',new Vector2(29, 17)},                                 
		
		
		
//		//自定义部分。使用没有含义的Unicode来表示聊天中的特殊符号
//		{UIEmojiImage.CHAR_TRANSLATE,new Vector2(37,1)},
//		{UIEmojiImage.CHAR_VOICE,new Vector2(37,2)},
	};
	public class EmojiCharInfo
	{
		public int index;
		public float x;
		public float y;
		public float width;
		public float height;
		public string name;
	}

	[MenuItem("Custom/OldProject/ImageFont/CreateEmojiLua")]
	static void CreateEmojiLua()
	{
		var selected = Selection.activeObject;
		var path = AssetDatabase.GetAssetPath(selected);
		if (path.LastIndexOf(".fontsettings") < 0)
			return;
		Dictionary<int, EmojiCharInfo> characterDict = new Dictionary<int, EmojiCharInfo>();
		Font font = AssetDatabase.LoadAssetAtPath<Font>(path);
		CharacterInfo[] charInfos = font.characterInfo;
		int[] needInts = {62265,62541,62542,62976,62977,62978,62981,62985,62989,62990,62994,62995,63000,63009,63021,63024,63025,63026,63055,63764,63767};
		//int[] needInts = {62540,62541,62542,62543,63055,62976,62977,62978,62979,62980,62981,62982,62983,62984,62985,62992,62993,62994,62995,62996,62997,62998,62999,63000,63001,63008,63009,63010,63011,63012,63013,63014,63015,63016,63017,63024,63025,63026,63027,63028,63029,63030,63031,63032,63033,63040,63041,63042,63043,63044};
		int index = 1;
		for (int i = 0; i < charInfos.Length; i++)
		{
			CharacterInfo characterInfo = charInfos[i];
			bool isneed = false;
			for (int j =0; j< needInts.Length; j++)
			{
				if (characterInfo.index == needInts[j])
				{
					isneed = true;
					break;
				}
			}
			if (isneed == true) 
			{
				EmojiCharInfo emojiCharInfo = new EmojiCharInfo();
				emojiCharInfo.index = characterInfo.index;
				emojiCharInfo.x = characterInfo.uv.x;
				emojiCharInfo.y = characterInfo.uv.y;
				emojiCharInfo.width = characterInfo.uv.width;
				emojiCharInfo.height = characterInfo.uv.height;
				emojiCharInfo.name = characterInfo.index.ToString("x4");
				characterDict.Add(index, emojiCharInfo);
				index ++;
			}
		}

		Lua.LuaSerializer s = new Lua.LuaSerializer();
		string luaStr = s.Serialize(characterDict);
		string exportLuaDirPath = "Assets/ToLua/Lua/config/";
		if (System.IO.Directory.Exists(exportLuaDirPath))
		{
			System.IO.Directory.CreateDirectory(exportLuaDirPath);
		}
		string luaConfigPath = exportLuaDirPath + "emoji.lua";
		CommonUtil.stringToFile(luaConfigPath, "return " + luaStr);
		Debug.Log(selected.name);
	}
}
